package com.project.core.service.impl;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.project.core.dao.IUsersDAO;
import com.project.core.model.Users;
import com.project.core.service.IUsersService;

@Service
public class UsersServiceImpl implements IUsersService {
	
	private static Logger logger = Logger.getLogger(UsersServiceImpl.class);
	
	@Autowired
	private IUsersDAO usersDao;

	@Cacheable(value="data")
	public List<Users> getAllUser() {
		logger.info("[Service]getAllUser Execute!");
		return usersDao.queryUsersByAll();
	}

	@Override
	public Users getUserById(String username) {
		return usersDao.queryUserById(username);
	}
	
}
